package net.xdclass.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import redis.clients.jedis.StreamInfo;

public class AlipayConfig {
    /*
    支付宝 网关地址
     */
    public static final String PAY_GATEWAY = "https://openapi.alipaydev.com/gateway.do";
    /**
     * 支付宝 appid
     */
    public static final String APPID = "2021000119630644";
    /**
     * 应用 私钥
     */
    public static final String APP_PRI_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMnKKDggxsJzbhlpwuctAeIoBOkfVOFHxWJ/WQsxAS5pf9c7CpsFZ5Hqq4a0ddFu+EAtgYjXCTX76MbDkINA4LVBERIW8rb1Z+Orrs3pMD3bnG6ph0sAOxpN/lxr0tGBygqecBoEIV2jZRJMZnP6KF0bsxw0zDyjLd++wWviiCBbdPia7OPglIy070OqRPZC0yuUHoGTODBl1yIGYEJQKnd5mk8X4KGrFLzFicM/qlYaO+2GCxnjkncsJLyP3aZLqiMoM7sXpytM4HA17m6Y2OL4UX8OSZXdXMHNuuewFjfyS+Ag26K2IdvFiP76bCX08OMU8mFVOtDJgz8jw/HIKLAgMBAAECggEAQUhgmbDuobtJSWSyZCeBu3uqkGcFa2oh2aNaOFbJdB5atCUrYpi+nlpogfrIhC0DMo1twTeviXXs6ATHlZR2PqsN3vdZ7vPRFulKJrVFFuCxm4PSLLjUFOPUBA4K4c5lo+VRrTUioLJEzlL7condIvEt1szHO1jSLf1o8ECvz/vMNqvzffF7a8NmNzafsNp+3hHeHazLhWAqnszu1ZCEhPDG07zEUr7m4GQRH7tOYGzdo20fXgXqMQUcduSHuhKgK4lrSvGIOcwlNTUL6WhLu6zYVmMrTfchN5pEk9XdanTETpx38WgpcQdIhkp0BmHZdyq0u8PDADuj9gTohFiHYQKBgQD7Xs0NYNaZWAVEZPRZbCp9e67c+cLx9PbiP6abzVqUR23J64YYzTRhu4beFClGId05S/Plr4vVEVbJuL1s7a9L2dp2ny+c9J96djoJD9MXQUMqaWKgP+F2nnwQ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vzAzapLG69WoawN2g/AQWEBNsJr0hUIxbhuc6NLb80ftzVOj6cM2F1FHoyr83FOmfuKonbWlp8plyEI+QfOcvza23H7LY02SRMkJZ9VG69Em9lD7Ey0sxg7jwIDAQAB/XOwqbBWeR6quGtHXRbvhALYGI1wk1++jGw5CDQOC1QRESFvK29Wfjq67N6TA925xuqYdLADsaTf5ca9LRgcoKnnAaBCFdo2USTGZz+ihdG7McNMw8oy3fvsFr4oggW3T4muzj4JSMtO9DqkT2QtMrlB6BkzgwZdciBmBCUCp3eZpPF+ChqxS8xYnDP6pWGjvthgsZ45J3LCS8j92mS6ojKDO7F6crTOBwNe5umNji+FF/DkmV3VzBzbrnsBY38kvgINuitiHbxYj++mwl9PDjFPJhVTrQyYM/I8PxyCiwIDAQAB";
    /**
     * 签名
     */
    public static final String SIGN_TYPE = "RSA2";
    /**
     * 编码格式
     */
    public static final String CHARSET = "utf-8";
    /**
     * 仅支持JSON
     */
    public static final String FORMAT = "JSON";

    private AlipayConfig() {

    }

    //volatile 防止指令重排
    private volatile static AlipayClient instance = null;

    public static AlipayClient getInstance() {

        if (instance == null) {
            synchronized (AlipayConfig.class){
                if (instance == null) {
                    instance = new DefaultAlipayClient(PAY_GATEWAY, APPID, APP_PRI_KEY, FORMAT, CHARSET, ALIPAY_PUB_KEY, SIGN_TYPE);
                }
            }
        }
        return instance;
    }

}
